package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.ServeProviderCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author lww
 */
@Api("服务端 - 服务人员审核接口")
@RestController
@RequestMapping("/worker/worker-certification-audit")
public class ServeProviderCertificationAuditController {
    @Resource
    private ServeProviderCertificationAuditService serveProviderCertificationAuditService;

    /**
     * 服务人员提交认证
     * @param dto 服务人员认证申请请求体
     */
    @ApiOperation("服务人员提交认证")
    @ApiImplicitParam(name = "dto",value = "服务人员认证申请请求体",required = true,dataTypeClass = WorkerCertificationAuditAddReqDTO.class)
    @PostMapping("")
    public void workerCertificationAudit(@RequestBody WorkerCertificationAuditAddReqDTO dto){
        serveProviderCertificationAuditService.workerCertificationAudit(dto);
    }

    /**
     * 查询最新的驳回的原因
     */
    @ApiOperation("查询最新的驳回原因")
    @GetMapping("/rejectReason")
    public RejectReasonResDTO getRejectReason(){
        return serveProviderCertificationAuditService.getRejectReason();
    }
}
